test(app-route-graph): build the dot-directory expectation with canonical()#2601
Open
shulaoda wants to merge 1 commit into
Conversation
commit: |
Contributor
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
One-line fixture conform: the dot-directory route-handler test (#2531) built its
routePathexpectation withpath.posix.join(appDir, ...), which produces a mixed-separator value on Windows (C:\...\app/.well-known/...) becauseappDircomes frommkdtempin native form. The route graph returns canonical forward-slash paths, so the expectation now goes through the file's existingcanonical()helper like every other path assertion in this suite.Why
No source change is needed for dot-directory scanning itself: the scanner's
{**,**/.*/**}pattern is correct, and the only reason it misbehaved locally was Node's globstar bug (nodejs/node#56321,**never descends into dot-directories; fixed by nodejs/node#61012). Current Node releases carry the fix — verified empirically on 26.4.0, where every pattern variant matches.well-known/...— so the resolution on dev machines is upgrading Node (pnpm env use --global latest) rather than adding a workaround for unfixed versions.Testing
tests/app-route-graph.test.ts"discovers route handlers inside dot-directories like .well-known": red → green on Windows / Node 26.4.0.tests/file-matcher.test.ts"scans route files inside dot-directories": green on Node 26.4.0 with no changes (was red on 24.12.0 purely due to the Node bug).vp checkclean on the changed file.canonical()is byte-identical to the previous expression there.